// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';
/**
 * 基础菜单
 */
import main from '@/views/home/main';

/**
 * 个人中心-发帖页面
 * 
 */
import postArticle from '@/views/user/PostArticle.vue'

import userHome from '@/views/user/UserHome.vue'

import PostArticleInfo from '@/views/user/PostArticleInfo.vue'

import gameAnnouncement from '@/views/game/gameAnnouncement'

import mygame from '@/views/game/mygame'

import member from '@/views/system/member'

import tiezi from '@/views/system/tiezi'

import pinglun from '@/views/system/pinglun'

import gamelog from '@/views/game/gamelog'
// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [
            {
                path: '/home/main',
                name: '论坛中心',
                component: main,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/user/PostArticle',
                name: '发帖详情',
                component: postArticle,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/user/UserHome',
                name: '个人中心',
                component: userHome,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/user/PostArticleInfo',
                name: '个人中心',
                component: PostArticleInfo,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/game/gameAnnouncement',
                name: '游戏公告',
                component: gameAnnouncement,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/game/mygame',
                name: '主游戏',
                component: mygame,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/system/member',
                name: '人员管理',
                component: member,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/system/pinglun',
                name: '评论管理',
                component: pinglun,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/system/tiezi',
                name: '帖子管理',
                component: tiezi,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/game/gamelog',
                name: '游戏日志',
                component: gamelog,
                meta: {
                    requireAuth: true
                }
            }
        ]
    }]
})